﻿<Window
    x:Name="Root"
    x:Class="XClave.MousePath.MainView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="Mouse Path"
    WindowStyle="None"
    BorderThickness="0"
    AllowsTransparency="True"
    WindowStartupLocation="Manual" 
    Background="Transparent" 
    Icon="pack://siteoforigin:,,,/Resources/Mouse.ico">

    <Window.InputBindings>
        <KeyBinding
            Key="X"
            Modifiers="Control"
            Command="{Binding ExitCommand}" />
    </Window.InputBindings>

    <Grid
        x:Name="container"
        Background="#99FFFFFF">
        <Image
            Source="{Binding CurrentCachedImage}"
            Stretch="Fill"
            Margin="0"
            Width="{Binding ActualWidth, ElementName=Root}"
            Height="{Binding ActualHeight, ElementName=_canvas}" />
        <Canvas
            x:Name="_canvas" />
        <StackPanel
            Orientation="Horizontal"
            Height="Auto"
            Width="Auto"
            HorizontalAlignment="Left"
            VerticalAlignment="Top"
            Margin="0,4,0,0">
            <Button
                Command="{Binding ExportCommand}"
                Content="Export"
                Height="Auto"
                Width="Auto"
                HorizontalAlignment="Left"
                VerticalAlignment="Center"
                Margin="0,0,10,0"
                CommandParameter="{Binding ElementName=container, Mode=OneWay}" />
            <Button
                Command="{Binding ResetCommand}"
                Content="Reset"
                Height="Auto"
                Width="Auto"
                HorizontalAlignment="Left"
                VerticalAlignment="Center"
                Margin="0,0,10,0"
                CommandParameter="{Binding ElementName=_canvas, Mode=OneWay}" />
            <Button
                Command="{Binding ResizeCommand}"
                Content="Resize"
                Height="Auto"
                Width="Auto"
                HorizontalAlignment="Left"
                VerticalAlignment="Center"
                Margin="0,0,10,0"
                CommandParameter="{Binding ElementName=Root, Mode=OneWay}" />

            <TextBlock
                Width="Auto"
                Height="Auto"
                HorizontalAlignment="Left"
                VerticalAlignment="Center"
                Background="Transparent">
            <TextBlock.Text>
                <MultiBinding
                        StringFormat="{}{0},{1} [{2},{3}]">
                    <Binding
                            Path="MouseX" />
                    <Binding
                            Path="MouseY" />
                    <Binding
                            Path="Left"
                            ElementName="Root" />
                    <Binding
                            Path="Top"
                            ElementName="Root" />
                </MultiBinding>
            </TextBlock.Text>
            </TextBlock>
        </StackPanel>
    </Grid>
</Window>
